var initstate={
    detailList:[],
    totalPro:0,
    totalPrice:0
}
function reducer(state=initstate,action){
    switch(action.type){
        case 'GETDETAIL':
            return {...state,detailList:action.payload};
        case 'INCREASE':
           return {...state,totalPro:state.totalPro+1};
        case 'INCREASE2':
           return {...state,totalPrice:state.totalPrice+action.payload};
        case 'SETZERO':
           return {...state,totalPrice:0};
        default:
            return state
    }
}

export default reducer;